package com.example.opengl_test00;
import android.app.ActivityManager;
import android.content.Context;
import android.content.pm.ConfigurationInfo;
import android.opengl.GLSurfaceView;

import android.opengl.GLES20;
import android.util.Log;


public class GLESSurfaceView extends GLSurfaceView {

	public GLESSurfaceView(Context context) {
		super(context);
		
		// Check if the system supports OpenGL ES 2.0.
	    final ActivityManager activityManager = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
	    final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
	    final boolean supportsEs2 = configurationInfo.reqGlEsVersion >= 0x20000;
	 
//	    if (supportsEs2)
//	    {
//	        // Request an OpenGL ES 2.0 compatible context.
//	        setEGLContextClientVersion(2);
//	 
//	        // Set the renderer to our demo renderer, defined below.
//	        setRenderer(new GLES20SpaceRenderer(context));
//	    }
//	    else
	    {
	    	Log.e("GLES20SurfaceView", "GlEsVersion = " + configurationInfo.reqGlEsVersion);
	        // This is where you could create an OpenGL ES 1.x compatible
	        // renderer if you wanted to support both ES 1 and ES 2.
	    	setRenderer(new SpaceRenderer(context));
	    }
	}
	
	
}
